//
//  FUtil.h
//  ui
//
//  Created by 袁飞 on 12-7-14.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FButton.h"
#import "TBXML.h"

@interface FUtil : NSObject


+(CGPoint)string2Point:(NSString*)str;
+(CGSize)string2Size:(NSString*)str;
+(CGPoint)actualPoint:(CGPoint)pos Size:(CGSize)s;
+(CGRect)scaleRect:(CGRect)rect Times:(float)sc;
+(NSMutableArray*)splitStr:(NSString*)src byFlag:(NSString*)f;
+(NSMutableArray*)getFramesNamed:(NSString*)name FromPlist:(NSString*)plname;

+(CCLayer*)layerFromFile:(NSString*)file;
+(FButton*)buttonFromXmlElement:(TBXMLElement*)element;
+(FButton*)buttonFromXmlFile:(NSString*)file;
+(CCSprite*)spriteFromXmlElement:(TBXMLElement*)element;
//+(CCLabelTTF*)label
+(CCLabelTTF*)labelFromXmlElement:(TBXMLElement*)element;


+(NSMutableDictionary*)getDictFromAttribute:(TBXMLElement*)element;
+(NSString*)expandStr:(NSString*)str WithDict:(NSMutableDictionary*)dict;
+(NSString*)expandFile:(NSString*)file WithDict:(NSMutableDictionary*)dict;
+(CCLayer*)layerFromFile:(NSString*)file withDict:(NSMutableDictionary*)dict;

+(CGSize)getSize:(TBXMLElement*)element;
+(CGPoint)getPosition:(TBXMLElement*)element;
+(NSString*)getName:(TBXMLElement*)element;
+(NSString*)getImg:(TBXMLElement*)element;
+(int)getZ:(TBXMLElement*)element;
+(float)getDur:(TBXMLElement*)element;
+(CCAction*)actionWith:(NSString*)file  WithDict:(NSMutableDictionary*)dict;

+(CCLayer*)wndFromFile:(NSString*)file;
@end
